home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 44
/
Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso
/
-in_the_mag-
/
basics
/
prime_tests
/
primes3000.bas
< prev
next >
Wrap
BASIC Source File
|
1999-07-24
|
392b
|
23 lines
' This program finds the prime-numbers from 2 to 3000.
' It has been tested in Cursor and HiSoft BASICs.
DEFINT a-z
SCREEN 2,640,200,1,2
PRINT "prime numbers from 2 to 3000:"
BeginTime! = TIMER
FOR a = 2 TO 3000
FOR b = 3 TO a-1
IF a MOD b = 0 THEN NotPrim
NEXT b
PRINT a
NotPrim:
NEXT a
PRINT "time needed:"+STR$(TIMER-BeginTime!)+" s."
WHILE INKEY$ = "" : WEND